package com.dunqi.gpm.cangxi.WeekReport.Model;

import android.text.TextUtils;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.io.Serializable;
import java.util.List;

public class WeeklyPlanBean implements Serializable {
    /**
     * status : 4
     * remark : 2323542345
     * weeklyReportId : 35
     * projectId : 208
     * weeklyPlanId : null
     * weeks : 1
     * context : null
     * createId : null
     * createTime : 2018-05-24
     * picRemarkRecords : [{"fileName":"TIM截图20180514111410.png","extName":"png","url":"groupa/M00/00/08/wKgBMlr6R3SAc81PAAAXgkIVFk8944.png","remark":"2323542345","index":0,"size":6018}]
     */

    private int status;
    private String remark;
    private int weeklyReportId;
    private int projectId;
    private int weeklyPlanId;
    private int weeks;
    private String context;
    private Object createId;
    private String createTime;
    private String picRemarkRecords;

    public List<Pic> getPics() {
//        [{"fileName":"TIM截图20180514111410.png","extName":"png","url":"groupa/M00/00/08/wKgBMlr6R3SAc81PAAAXgkIVFk8944.png","remark":"2323542345","index":0,"size":6018}]
        if (!TextUtils.isEmpty(picRemarkRecords) && picRemarkRecords.length() > 10) {
            return new Gson().fromJson(picRemarkRecords, new TypeToken<List<Pic>>() {
            }.getType());
        }
        return null;
    }

    public class Pic {

        /**
         * fileName : TIM截图20180514111410.png
         * extName : png
         * url : groupa/M00/00/08/wKgBMlr6R3SAc81PAAAXgkIVFk8944.png
         * remark : 2323542345
         * index : 0
         * size : 6018
         */

        private String fileName;
        private String extName;
        private String url;
        private String remark;
        private int index;
        private int size;

        public Pic objectFromData(String str) {

            return new Gson().fromJson(str, Pic.class);
        }

        public String getFileName() {
            return fileName;
        }

        public void setFileName(String fileName) {
            this.fileName = fileName;
        }

        public String getExtName() {
            return extName;
        }

        public void setExtName(String extName) {
            this.extName = extName;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public String getRemark() {
            return remark;
        }

        public void setRemark(String remark) {
            this.remark = remark;
        }

        public int getIndex() {
            return index;
        }

        public void setIndex(int index) {
            this.index = index;
        }

        public int getSize() {
            return size;
        }

        public void setSize(int size) {
            this.size = size;
        }
    }

    private int years;

    public static WeeklyPlanBean objectFromData(String str) {

        return new Gson().fromJson(str, WeeklyPlanBean.class);
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public int getWeeklyReportId() {
        return weeklyReportId;
    }

    public void setWeeklyReportId(int weeklyReportId) {
        this.weeklyReportId = weeklyReportId;
    }

    public int getProjectId() {
        return projectId;
    }

    public void setProjectId(int projectId) {
        this.projectId = projectId;
    }

    public int getWeeklyPlanId() {
        return weeklyPlanId;
    }

    public void setWeeklyPlanId(int weeklyPlanId) {
        this.weeklyPlanId = weeklyPlanId;
    }

    public int getWeeks() {
        return weeks;
    }

    public void setWeeks(int weeks) {
        this.weeks = weeks;
    }

    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context;
    }

    public Object getCreateId() {
        return createId;
    }

    public void setCreateId(Object createId) {
        this.createId = createId;
    }

    public String getCreateTime() {
        return createTime;
    }

    public int getYears() {
        return years;
    }

    public void setYears(int years) {
        this.years = years;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getPicRemarkRecords() {
        return picRemarkRecords;
    }

    public void setPicRemarkRecords(String picRemarkRecords) {
        this.picRemarkRecords = picRemarkRecords;
    }

}